namespace rateITcd.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class Initial : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "dbo.RestaurantDishes",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        Name = c.String(),
                        Price = c.Double(nullable: false),
                        Restaurant_Id = c.Int(),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.Restaurants", t => t.Restaurant_Id)
                .Index(t => t.Restaurant_Id);
            
            CreateTable(
                "dbo.DishReviews",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        Reviewer = c.String(),
                        Score = c.Int(nullable: false),
                        Comment = c.String(),
                        RestaurantDish_Id = c.Int(),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.RestaurantDishes", t => t.RestaurantDish_Id)
                .Index(t => t.RestaurantDish_Id);
            
            CreateTable(
                "dbo.Restaurants",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        Name = c.String(),
                        Phone = c.String(),
                        AdressStreet = c.String(),
                        AdressNumber = c.String(),
                        AdressZip = c.String(),
                        AdressCity = c.String(),
                        Latitude = c.String(),
                        Longtitude = c.String(),
                    })
                .PrimaryKey(t => t.Id);
            
        }
        
        public override void Down()
        {
            DropForeignKey("dbo.RestaurantDishes", "Restaurant_Id", "dbo.Restaurants");
            DropForeignKey("dbo.DishReviews", "RestaurantDish_Id", "dbo.RestaurantDishes");
            DropIndex("dbo.DishReviews", new[] { "RestaurantDish_Id" });
            DropIndex("dbo.RestaurantDishes", new[] { "Restaurant_Id" });
            DropTable("dbo.Restaurants");
            DropTable("dbo.DishReviews");
            DropTable("dbo.RestaurantDishes");
        }
    }
}
